/*
   Copyright (c) [2023] [魔凤啸天]
   [MFUI] is licensed under Mulan PSL v2.
   You can use this software according to the terms and conditions of the Mulan PSL v2. 
   You may obtain a copy of Mulan PSL v2 at:
            http://license.coscl.org.cn/MulanPSL2 
   THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.  
   See the Mulan PSL v2 for more details.  
*/
#include "label.hpp"

namespace MFUI{
	void Label::_updatebase(){redraw=true,notifyparent();}
	void Label::_updatetext(){_updatebase();}
	Label::~Label(){}
	Label::Label(const std::string& text,Font* font,Align align,int fontsize,
	SDL_Color textcolor,SDL_Color background):
	TextNodeBase(text,font,fontsize,textcolor,background,align){}
	void Label::draw(Renderer* r,bool updatecache){
		_draw(r,updatecache);
		_tryrendertext(r,&rect);
		redraw=false;
	}
}